package com.itheima.test3;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

/**
 * @Author:gy
 * @Date: 2025/08/28 11:08
 * @Description:
 */
public class Demo1 {
    public static void main(String[] args) throws Exception {
        long start = System.currentTimeMillis();
        //读  到内存  输入流
        FileInputStream fis = new FileInputStream("D:\\班级\\93期\\day10-IO\\测试\\素材\\ち痴か汉ん.avi");
        //写  到硬盘  输出流
        FileOutputStream fos = new FileOutputStream("Day10\\ち痴か汉ん.avi");//17
        //得有一个数组  读到的字符是存在数组中的
        byte[] bytes = new byte[4196*2];//1024
        int len;
        while ((len=fis.read(bytes))!=-1) {
            //高斯林设计  读字符数组的得时候 读完了 也返回 -1
           // System.out.println(new String(bytes,0,len));
            fos.write(bytes,0,len);
        }
        fis.close();
        fos.close();
        long end = System.currentTimeMillis();
        System.out.println(end-start);
    }
}
